{include file="public/top_and_left"}

<article class="page-container">
    <div class="form form-horizontal" id="form-article-add">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>分类标题：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="" placeholder="" id="title" name="">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">分类描述：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="" placeholder="" id="description" name="">
            </div>
        </div>


        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">分类SEO_T：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="" placeholder="" id="seo_t" name="">
            </div>
        </div>


        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">分类SEO_k：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="" placeholder="" id="seo_k" name="">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">分类SEO_D：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="" placeholder="" id="seo_d" name="">
            </div>
        </div>

        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
                <button onClick="article_save_submit();" class="btn btn-primary radius" type="submit">点击添加</button>
                <button onClick="removeIframe();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
    </div>
</article>
<script>
    function article_save_submit() {
        var title = $('#title').val().replace(/\s*/g, "");
        var description = $('#description').val().replace(/\s*/g, "");
        var seo_t = $('#seo_t').val().replace(/\s*/g, "");
        var seo_k = $('#seo_k').val().replace(/\s*/g, "");
        var seo_d = $('#seo_d').val().replace(/\s*/g, "");
        post(title, description, seo_t, seo_k, seo_d);
    }

    function post(title, description, seo_t, seo_k, seo_d) {
        $.post("{:url('news/group_add')}", {
            title: title,
            description: description,
            seo_t: seo_t,
            seo_k: seo_k,
            seo_d: seo_d
        }, function (data) {
            layer.msg(data.mes);
            if (data.status==200) {
              window.location.href="{:url('news/group')}";
            }
        })
    }
</script>

{include file="public/foot"}
